package com.directv.z8training.EMS.Entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the GROUP_RIGHT database table.
 * 
 */
@Embeddable
public class GroupRightPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(insertable=false, updatable=false)
	private String rightcode;

	@Column(insertable=false, updatable=false)
	private String groupcode;

	public GroupRightPK() {
	}
	public String getRightcode() {
		return this.rightcode;
	}
	public void setRightcode(String rightcode) {
		this.rightcode = rightcode;
	}
	public String getGroupcode() {
		return this.groupcode;
	}
	public void setGroupcode(String groupcode) {
		this.groupcode = groupcode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof GroupRightPK)) {
			return false;
		}
		GroupRightPK castOther = (GroupRightPK)other;
		return 
			this.rightcode.equals(castOther.rightcode)
			&& this.groupcode.equals(castOther.groupcode);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.rightcode.hashCode();
		hash = hash * prime + this.groupcode.hashCode();
		
		return hash;
	}
}